package com.homework.oop;

public class Number {
  private int n1;
  private int n2;

  public Number(int n1, int n2) {
    this.n1 = n1;
    this.n2 = n2;
  }

  public void addition() {
    System.out.println("两数之和为：" + (this.n1 + this.n2));
  }

  public void subtration() {
    System.out.println("两数之差为：" + (this.n1 - this.n2));
  }

  public void multiplication() {
    System.out.println("两数之积为：" + (this.n1 * this.n2));
  }

  public void division() {
    System.out.println("两数之商为：" + (this.n1 / this.n2) + ",余：" + (this.n1 % this.n2));
  }

  public static void main(String[] args) {
    Number nb = new Number(100,30);
    nb.addition();
    nb.division();
    nb.multiplication();
    nb.subtration();

  }
}
